UI3DHUtilities Class Reference

UI3DHUtilities Class Reference#

instant3Dhub: UI3DHUtilities Class Reference
instant3Dhub
UI3DHUtilities Class Reference

#include "I3DHUtilities.h"

Inheritance diagram for UI3DHUtilities:
Collaboration diagram for UI3DHUtilities:

Detailed Description

Utility functions for using Unreal Engine with Instant3DHub.

Static Public Member Functions

static float GetOriginalToUnrealScale ()
static const FMatrix & GetOriginalToUnrealMatrix ()
static const FMatrix & GetUnrealToOriginalMatrix ()
static const FMatrix & GetOriginalToUnrealNormalMatrix ()
static const FMatrix & GetUnrealToOriginalNormalMatrix ()
static FMatrix ConvertTransformOriginalToUnreal (const FMatrix &OriginalTransform)
static FMatrix ConvertTransformUnrealToOriginal (const FMatrix &UnrealTransform)
static FMatrix ConvertTransformOriginalToUnrealPure (const FMatrix &OriginalTransform)
static FMatrix ConvertTransformUnrealToOriginalPure (const FMatrix &UnrealTransform)
static FBox ConvertVolumeOriginalToUnreal (const FBox &OriginalVolume)
static FBox ConvertVolumeUnrealToOriginal (const FBox &UnrealVolume)
static FBox ConvertVolumeOriginalToUnrealPure (const FBox &OriginalVolume)
static FBox ConvertVolumeUnrealToOriginalPure (const FBox &UnrealVolume)
static FString UEColorToWebvisAppearanceURI (const FLinearColor &Color, EAppearanceURIMode Mode)
static bool WebvisAppearanceURIToUEColor (const FString &InURI, FLinearColor &OutColor, EAppearanceURIMode &OutMode)
static bool AnalyzeHitResult (const struct FHitResult &HitResult, FI3DHHitResult &OutI3DHHitResult, bool bRequestDetailNode=false)
static FPlane MakePlaneFromClipPlaneActor (const AActor *ClipPlaneActor)
static bool ClipLineSegmentByPlane (FVector &Start, FVector &End, const FPlane &Plane)
static bool ClipLineSegmentByMainClipPlane (AI3DHConnector *HubConnector, FVector &Start, FVector &End)
static bool ClipLineSegmentByClipPlanes (AI3DHConnector *HubConnector, FVector &Start, FVector &End)
static bool IsWithEditor ()
static bool IsEditorStandaloneGame (const UObject *WorldContextObject)
static TMap< FString, FStringGetURLQueryParams (const FString &URL)
static bool IsURN (const FStringView URI)
static FString ExtractNamespaceIdentifier (FStringView URI)
static bool IsValidNamespaceIdentifier (FStringView NamespaceIdentifier, FString *OutValidationError=nullptr)
static bool IsReservedNamespaceIdentifier (FStringView NamespaceIdentifier, FString *OutValidationError=nullptr)
static FStringView GetNamespaceSpecificString (const FStringView URN, const FStringView NamespaceIdentifier)
static void FindFirstUnselectedAncestor (TSharedPtr< class FI3DHConnectorAPI > API, int32 NodeId, TUniqueFunction< void(int32 AncestorId, EI3DHErrorCode ErrorCode)> OnComplete)

Member Function Documentation

◆ AnalyzeHitResult()

bool UI3DHUtilities::AnalyzeHitResult ( const struct FHitResult & HitResult,
FI3DHHitResult & OutI3DHHitResult,
bool bRequestDetailNode = false )
static

Analyzes a hit result to check if and what instant3Dhub geometry was hit.

Parameters
HitResultOriginal hit result from e.g. a regular line trace.
OutI3DHHitResultinstant3Dhub-specific hit information. If no instant3Dhub geometry was hit, the value is not changed.
bRequestDetailNodeIf true, asynchronously requests the structure mapping for the hit instance (if not already available). Once available, subsequent calls will populate FI3DHHitResult::DetailNodeId with the leaf node id.
Returns
true if instant3Dhub geometry was hit.

◆ ExtractNamespaceIdentifier()

FString UI3DHUtilities::ExtractNamespaceIdentifier ( FStringView URI)
static

Extracts the Namespace Identifier (NID) from a URN urn:NID:NSS.

Returns an empty string if the URI is not a URN or does not contain an NID.

◆ FindFirstUnselectedAncestor()

void UI3DHUtilities::FindFirstUnselectedAncestor ( TSharedPtr< class FI3DHConnectorAPI > API,
int32 NodeId,
TUniqueFunction< void(int32 AncestorId, EI3DHErrorCode ErrorCode)> OnComplete )
static

Finds the first ancestor node that is not selected, excluding the root node.

Parameters
APIThe instant3Dhub API.
NodeIdIdentifier of the node.
OnCompleteCallback called on completion:

◆ GetNamespaceSpecificString()

FStringView UI3DHUtilities::GetNamespaceSpecificString ( const FStringView URN,
const FStringView NamespaceIdentifier )
inlinestatic

Returns the Namespace-Specific String (NSS) from a URN urn:NID:NSS.

◆ GetURLQueryParams()

TMap< FString, FString > UI3DHUtilities::GetURLQueryParams ( const FString & URL)
static

Parse the provided URL and retrieve its URL query parameters.

Remarks
This is not BlueprintPure to prevent the user from accidentally re-parsing every time the output map is used directly without storing it in a local variable first.
Parameters
URLURL of the resource.
Returns
Map of the URL query parameters.

◆ IsEditorStandaloneGame()

bool UI3DHUtilities::IsEditorStandaloneGame ( const UObject * WorldContextObject)
static

Query if the current build is an Editor build of the engine and the provided 'WorldContextObject' is part of a game world.

Parameters
WorldContextObjectThe world context object.
Returns
True if object is part of editor standalone game world, false if not.

◆ IsReservedNamespaceIdentifier()

bool UI3DHUtilities::IsReservedNamespaceIdentifier ( FStringView NamespaceIdentifier,
FString * OutValidationError = nullptr )
static

Checks whether a Namespace Identifier avoids the prefixes reserved by the plugin.

Returns true when the NID is reserved with respect to custom connector bindings. Returns false otherwise.

◆ IsURN()

bool UI3DHUtilities::IsURN ( const FStringView URI)
inlinestatic

Returns whether the string starts with the URN prefix urn:.

◆ IsValidNamespaceIdentifier()

bool UI3DHUtilities::IsValidNamespaceIdentifier ( FStringView NamespaceIdentifier,
FString * OutValidationError = nullptr )
static

Validates that a Namespace Identifier can be used for Custom Material URNs.

Returns true when the NID fulfills all the following requirements:

  • must be longer than 2 characters.
  • may only contain letters, digits, and '-'.

◆ IsWithEditor()

bool UI3DHUtilities::IsWithEditor ( )
static

Query if the current build is an Editor build of the engine.

Returns
True if with editor, false if not.

◆ UEColorToWebvisAppearanceURI()

FString UI3DHUtilities::UEColorToWebvisAppearanceURI ( const FLinearColor & Color,
EAppearanceURIMode Mode )
static

Converts color to the matching WebVis appearanceURI.

Parameters
ColorThe color.
ModeThe appearanceURI Mode.
Returns
A WebVis appearanceURI String, e.g. urn:X-l3d:color:rgba:983BC0D3.

◆ WebvisAppearanceURIToUEColor()

bool UI3DHUtilities::WebvisAppearanceURIToUEColor ( const FString & InURI,
FLinearColor & OutColor,
EAppearanceURIMode & OutMode )
static

Converts a WebVis appearanceURI (e.g.

"") to the matching color.

Parameters
InURIWebVis appearanceURI String, e.g. urn:X-l3d:color:rgba:983BC0D3.
OutColorThe color obtained from the appearanceURI string.
OutModeThe appearanceURI Mode as obtained from the appearanceURI string.
Returns
True if the input is and output values are matching WebVis, false otherwise.

The documentation for this class was generated from the following file: